/*
 * @Description:
 * @Autor: lcz
 * @Date: 2022-06-23 13:34:29
 * @LastEditors: lcz
 * @LastEditTime: 2022-06-24 15:20:08
 */
import { ReactNode } from 'react'
import { Popconfirm } from 'antd'
export type placementEnum =
  | 'top'
  | 'bottom'
  | 'left'
  | 'right'
  | 'topLeft'
  | 'topRight'
  | 'leftTop'
  | 'leftBottom'
  | 'rightTop'
  | 'rightBottom'
  | 'bottomLeft'
  | 'bottomRight'
export interface PopConfigProps {
  title?: string
  confirm?: (e?: any) => void
  cancel?: (e?: any) => void
  okText?: string
  cancelText?: string
  children: ReactNode
  showCancel: boolean
  placement: placementEnum
}

const PopConfigComponent = (props: PopConfigProps) => {
  return (
    <Popconfirm
      title={props.title}
      onConfirm={props.confirm}
      onCancel={props.cancel}
      okText={props.okText}
      cancelText={props.cancelText}
      showCancel={props.showCancel}
      placement={props.placement}
    >
      {props.children}
    </Popconfirm>
  )
}
export default PopConfigComponent
